<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 1 引入vue.js文件 -->
    <script src="js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好的数据 -->
    <div id="app">
      <table border="1px" cellspacing="0" width="100%">
        <tr>
          <th>编号</th>
          <th>姓名</th>
          <th>年龄</th>
          <th>性别</th>
          <th>成绩</th>
          <th>等级</th>
        </tr>

        <tr align="center" v-for="(item,index) in users">
          <td>{{index + 1}}</td>
          <td>{{item.name}}</td>
          <td>{{item.age}}</td>
          <td>{{item.gender == 1 ? "男" : "女"}}</td>
          <td>{{item.score}}</td>
          <td>
            <span v-show="item.score >= 85 && item.score <= 100">优秀</span> 
            <span v-show="item.score >= 60 && item.score <= 84">及格</span> 
            <span v-show="item.score >= 0 && item.score <= 59" style="color:red" >不及格</span> 
          </td>
        </tr>

        

      </table>
    </div>
  </body>

  <script>
    // 准备好的数据
    new Vue({
      el: "#app",
      data: {
        users: [
          {
            name: "Tom",
            age: 20,
            gender: 1,
            score: 78,
          },
          {
            name: "Rose",
            age: 18,
            gender: 2,
            score: 86,
          },
          {
            name: "Jerry",
            age: 26,
            gender: 1,
            score: 90,
          },
          {
            name: "Tony",
            age: 30,
            gender: 1,
            score: 52,
          },
        ],
      },
    });
  </script>
</html>
